﻿<UserControl x:Class="Big3.Hitbase.MainControls.PersonGroupViewDetails"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:hc="clr-namespace:Big3.Hitbase.Controls;assembly=Controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Big3.Hitbase.MainControls"
             xmlns:sr="clr-namespace:Big3.Hitbase.SharedResources;assembly=Big3.Hitbase.SharedResources"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <Storyboard x:Key="ShowSearchPictureButton">
                <DoubleAnimation Storyboard.TargetName="SearchPictureButton" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.5">
                </DoubleAnimation>
            </Storyboard>
            <Storyboard x:Key="HideSearchPictureButton">
                <DoubleAnimation Storyboard.TargetName="SearchPictureButton" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.5">
                </DoubleAnimation>
            </Storyboard>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <ListBox x:Name="itemsControl" Background="Transparent" BorderThickness="0" 
                 HorizontalContentAlignment="Stretch"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 ScrollViewer.VerticalScrollBarVisibility="Auto" 
                 VirtualizingStackPanel.IsVirtualizing="True" 
                 VirtualizingStackPanel.VirtualizationMode="Recycling" 
                 ItemContainerStyle="{StaticResource MyListBoxItemContainerStyle}"
                 MouseDoubleClick="itemsControl_MouseDoubleClick">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Name="ItemContainer" BorderThickness="1" CornerRadius="5" BorderBrush="Transparent" > 
                        <DockPanel Name="GridRow" Background="Transparent" >
                            <Grid DockPanel.Dock="Left">
                                <Image VerticalAlignment="Top" Source="{Binding Path=Image}" Height="80" Width="100" Margin="0 5 10 10">
                                    <Image.Effect>
                                        <DropShadowEffect Color="LightGray" />
                                    </Image.Effect>
                                </Image>
                                <Button Name="SearchPictureButton" Width="30" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="60,60,0,0" Opacity="0" Click="SearchPictureButton_Click" ToolTip="{sr:Loc ClickHereToSearchPicture}">
                                    <Image Source="pack://application:,,,/Big3.Hitbase.SharedResources;component/Images/SearchPicture.png" />
                                </Button>
                                <Grid.Triggers>
                                    <EventTrigger RoutedEvent="Grid.MouseEnter">
                                        <BeginStoryboard Storyboard="{StaticResource ShowSearchPictureButton}" />
                                    </EventTrigger>
                                    <EventTrigger RoutedEvent="Grid.MouseLeave">
                                        <BeginStoryboard Storyboard="{StaticResource HideSearchPictureButton}" />
                                    </EventTrigger>

                                </Grid.Triggers>
                            </Grid>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="{Binding Name}" FontWeight="Bold" TextTrimming="CharacterEllipsis" Margin="0 3 0 3" />
                                <UniformGrid Columns="2">
                                    <TextBlock Text="{Binding TypeAndSex}" Margin="0 3 0 3" />
                                    <TextBlock Margin="0 3 0 3">
                                        <Hyperlink>
                                            <Run Text="{Binding URL}"/>
                                        </Hyperlink>
                                    </TextBlock>
                                </UniformGrid>
                                <UniformGrid Columns="2">
                                    <TextBlock Text="{Binding LandOfOrigin}" Margin="0 3 0 3" />
                                    <TextBlock Margin="0 3 0 3">
                                        <TextBlock.Text>
                                            <Binding StringFormat="Anzahl Tracks: {0}" Path="NumberOfTracks"> 
                                                
                                            </Binding>
                                        </TextBlock.Text>
                                    </TextBlock>
                                </UniformGrid>
                                <UniformGrid Columns="2">
                                    <TextBlock Text="{Binding DayOfBirth}" Margin="0 3 0 3" />
                                    <TextBlock Text="{Binding DayOfDeath}" Margin="0 3 0 3" />
                                </UniformGrid>
                            </StackPanel>
                        </DockPanel>
                    </Border>
                    <DataTemplate.Triggers>
                        <Trigger SourceName="ItemContainer" Property="IsMouseOver" Value="True">
                            <Setter TargetName="ItemContainer" Property="Background" >
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <!--<GradientStop Color="#F8FBFE" Offset="0" />
                                            <GradientStop Color="#E8F2FE" Offset="1" />-->
                                            <GradientStop Color="#90FFFFFF" Offset="0" />
                                            <GradientStop Color="#30FFFFFF" Offset="1" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="ItemContainer" Property="BorderBrush" Value="#400000FF" />
                        </Trigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
